// 引入ajax
import services from '../../services/services.js'
import config from '../../config/index.js'

class home {
  /**
   * 商品接口
   */
  GetBooks(data, isLoading = true) {
    return services.ajax({
      url: `${config.old_postUrl}/api/DataApi/GetBooks`,
      data: data,
      method: 'POST',
      isLoading,
    })
  }
    GetProductDetail(data, isLoading = true) {
    return services.ajax({
      url: `${config.old_postUrl}/api/DataApi/GetProductDetail`,
      data: data,
      method: 'POST',
      header:{"content-type":'application/x-www-form-urlencoded'},
      isLoading,
    })
  }
  AddCart(data, isLoading = true) {
    return services.ajax({
      url: `${config.old_postUrl}/api/DataApi/AddCart`,
      data: data,
      method: 'POST',
      header:{"content-type":'application/x-www-form-urlencoded'},
      isLoading,
    })
  }
  GatShopCart(data, isLoading = true) {
    return services.ajax({
      url: `${config.old_postUrl}/api/DataApi/GetShopCart`,
      data: data,
      method: 'POST',
      header:{"content-type":'application/x-www-form-urlencoded'},
      isLoading,
    })
  }
  Get_Big_Picture(data, isLoading = true) {
    return services.ajax({
      url: `${config.postUrl}/Get_Big_Picture?${data}`,
      data: data,
      method: 'get',
      isLoading,
    })
  }
  Get_Video(data, isLoading = true) {
    return services.ajax({
      url: `${config.postUrl}/Get_Video?${data}`,
      data: data,
      method: 'get',
      isLoading,
    })
  }

}

module.exports = new home() 